<template>
  <svg class="svg-icon" xmlns="http://www.w3.org/2000/svg" version="1.1">
    <use :xlink:href="iconName"></use>
  </svg>
</template>

<script>
export default {
  name: "SvgIcon.vue",
  props: {
    iconClass: {
      type: String,
      require: true
    }
  },
  computed: {
    iconName () {
      return `#icon-${ this.iconClass }`
    }
  }
}
</script>

<style scoped>
.svg-icon {
  width: 1em; height: 1em;
  vertical-align: -0.15em;
  fill: currentColor;
  overflow: hidden;
  font-size: 24px;
}
</style>